<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/9/7 0007
 * Time: 上午 9:41
 */
defined('BASEPATH') OR exit('No direct script access allowed');

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>会员管理-有点</title>
    <link rel="stylesheet" type="text/css" href="<?php echo base_url()?>public/admin/css/css.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo base_url()?>public/admin/css/manhuaDate.1.0.css">
    <script type="text/javascript" src="<?php echo base_url()?>public/admin/js/jquery.min.js"></script>
    <script type="text/javascript" src="<?php echo base_url()?>public/admin/js/manhuaDate.1.0.js"></script>
    <script type="text/javascript" src="<?php echo base_url()?>public/admin/js/jquery-1.7.2.min.js"></script>
    <!-- <script type="text/javascript" src="public/js/page.js" ></script> -->
    <script type="text/javascript">
        $(function (){
            $("input.mh_date").manhuaDate({
                Event : "click",//可选
                Left : 0,//弹出时间停靠的左边位置
                Top : -16,//弹出时间停靠的顶部边位置
                fuhao : "-",//日期连接符默认为-
                isTime : false,//是否开启时间值默认为false
                beginY : 1949,//年份的开始默认为1949
                endY :2100//年份的结束默认为2049
            });
        });
    </script>
    <style>
        .paging{text-align: center;width:100%;
            margin-top: 15px!important;}
        .clear{
            display: block;
            clear:both;
        }
        .paging a, .paging strong{
            display: inline-block;
            width:auto;
            padding: 0 10px;
            margin:0px 5px;
            height:32px;
            text-align: center;
            line-height:32px;
            border: 1px solid #47a4e1;
            color: #47a4e1;
            transition:all 0.2s;

        }

        .paging a:hover, .paging strong{
            color:#fff;
            background:#47a4e1;
            transition:all .2s;


    </style>
</head>

<body>
<div id="pageAll">
    <div class="pageTop">
        <div class="page">
            <img src="<?php echo base_url()?>public/admin/img/coin02.png" />
            <span>
                <a href="#">首页</a>&nbsp;-&nbsp;
                <a href="#">公共管理</a>&nbsp;-
            </span>&nbsp;意见管理
        </div>
    </div>

    <div class="page">
        <!-- vip页面样式 -->
        <div class="vip">
            <div class="conform">
                <form>
<!--                    <div class="cfD">
                        时间段：<input class="vinput mh_date" type="text" readonly="true" />&nbsp;&nbsp;&nbsp;-&nbsp;&nbsp;&nbsp;
                        <input class="vinput mh_date" type="text" readonly="true" />
                    </div>-->
                    <div class="cfD">
<!--                        <input class="addUser" type="text" placeholder="输入用户名/ID/手机号/城市" />
                        <button class="button">搜索</button>-->
                        <a class="addA addA1" href="addUser">新增会员+</a>
<!--                        <a
                            class="addA addA1 addA2" href="vipadd.html">密码重置
                        </a>-->
                    </div>
                </form>
            </div>
            <!-- vip 表格 显示 -->
            <div class="conShow">
                <table border="1" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="66px" class="tdColor tdC">序号</td>
                        <td width="250px" class="tdColor">头像</td>
                        <td width="188px" class="tdColor">姓名</td>
                        <td width="235px" class="tdColor">手机号码</td>
                        <td width="220px" class="tdColor">所在城市</td>
                        <td width="282px" class="tdColor">注册时间</td>
                        <td width="130px" class="tdColor">操作</td>
                    </tr>
                <?php foreach($user_data as $k=>$v):?>
                    <tr>
                        <td><?=$v['user_id']?></td>
                        <td>
                            <div class="onsImg onsImgv">
                                <img src="<?=$v['head_img']?>">
                            </div>
                        </td>
                        <td><?=$v['username']?></td>
                        <td><?=$v['phone']?></td>
                        <td><?=$v['user_address']?></td>
                        <td><?=$v['register_time']?></td>
                        <td>
                            <img class="operation" src="<?php echo base_url()?>public/admin/img/update.png">
                            <img class="operation delban" user_id="<?=$v['user_id']?>" src="<?php echo base_url()?>public/admin/img/delete.png">
                        </td>
                    </tr>
                <?php endforeach; ?>
                </table>

                <div class="paging" style="margin: 0 auto;">
                    <?=$link?>
                </div>
            </div>
            <!-- vip 表格 显示 end-->
        </div>
        <!-- vip页面样式end -->
    </div>

</div>


<!-- 删除弹出框 -->
<div class="banDel">
    <div class="delete">
        <div class="close">
            <a><img src="<?php echo base_url()?>public/admin/img/shanchu.png" /></a>
        </div>
        <p class="delP1">你确定要删除此条记录吗？</p>
        <p class="delP2">
            <a href="javascript:viod(0)" class="ok yes" del_id="">确定</a>
            <a class="ok no">取消</a>
        </p>
    </div>
</div>
<!-- 删除弹出框  end-->
</body>

<script type="text/javascript">
    // 广告弹出框
    $(".delban").click(function(){
        $(".banDel").show();
        //获取当前对象id
        var id = $(this).attr('user_id');
        //将当前id赋值给弹出框中自定义的属性中
        $('.yes').attr('del_id',id);
    });
    $(".close").click(function(){
        $(".banDel").hide();
    });
    $(".no").click(function(){
        $(".banDel").hide();
    });
    // 广告弹出框 end
    //删除用户
    $('.yes').click(function()
    {
        //获取删除对象的id
        var id = $(this).attr('del_id');
        $.ajax({
            url:"<?=site_url()?>/userManage/operate",
            type:'post',
            dataType:'json',
            data:{
                'type':'del',
                'id':id
            }
        })
        .done(function(ret)
        {
            if(ret.status=='success')
            {
                location.href="<?=site_url()?>/userManage/index";
                //关闭弹框
                $(".yes").click(function(){
                    $(".banDel").hide();
                });
            }

            if(ret.status=='false')
            {
                location.href="<?=site_url()?>/userManage/index";
                //关闭弹框
                $(".yes").click(function(){
                    $(".banDel").hide();
                });
                alert(ret.message);
            }

        })

    })
</script>
</html>
